package com.jxzyk.view;

import com.jxzyk.R;
import com.jxzyk.http.BaseRequest;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

public class NetLayout extends LinearLayout {

	private BaseRequest request = null;

	public BaseRequest getRequest() {
		return request;
	}

	public void setRequest(BaseRequest request) {
		this.request = request;
	}

	public NetLayout(Context context) {
		super(context);
		init(context);
	}

	public NetLayout(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	public NetLayout(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
		init(context);
	}

	private LinearLayout netLayout;

	private void init(Context context) {
		LayoutInflater.from(context).inflate(R.layout.common_netlayout2, this);
//		 netLayout = (LinearLayout) findViewById(R.id.contentDialog);
	}

	public void start() {
		if (request != null) {
			// netLayout.setVisibility(View.VISIBLE);
			// int visible = netLayout.getVisibility();
			request.start();
		}
	}

	public void stop() {
		// int visible = netLayout.getVisibility();
//		 netLayout.setVisibility(View.GONE);
		// visible = netLayout.getVisibility();
	}
}
